package com.ttg.web.dao.Impl;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
import com.ttg.model.po.BankPublicMerchTradePrimitivePO;
import com.ttg.model.pojo.BankPublicMerchTradePrimitive;
import com.ttg.model.mapper.BankPublicMerchTradePrimitiveMapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.ttg.model.vo.MerchTradePrimitiveSumVO;
import com.ttg.model.vo.MerchAcctInfoVO;
import com.ttg.web.dao.BankPublicMerchTradePrimitiveDao;
import org.apache.ibatis.annotations.Param;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * (TblBankPublicTradePrimitive) daoImpl
 *
 * @author chenyou
 * @datetime 2025-10-13 13:40:47
 */
@Service
public class BankPublicMerchTradePrimitiveDaoImpl extends ServiceImpl<BankPublicMerchTradePrimitiveMapper, BankPublicMerchTradePrimitive> implements BankPublicMerchTradePrimitiveDao {

    @Override
    public List<MerchTradePrimitiveSumVO> getParam(BankPublicMerchTradePrimitivePO po) {
        return baseMapper.getParam(po);
    }

    @Override
    public List<Long> getMerchNos(BankPublicMerchTradePrimitivePO po) {
        return baseMapper.getMerchNos(po);
    }


    @Override
    public boolean deleteByDay(int day) {
        LambdaUpdateWrapper<BankPublicMerchTradePrimitive> wrapper = new LambdaUpdateWrapper<>();
        wrapper.eq(BankPublicMerchTradePrimitive::getDataTime,day);
        return remove(wrapper);
    }

    @Override
    public boolean deleteByDays(List<Integer> days) {
        LambdaUpdateWrapper<BankPublicMerchTradePrimitive> wrapper = new LambdaUpdateWrapper<>();
        wrapper.in(BankPublicMerchTradePrimitive::getDataTime,days);
        return remove(wrapper);
    }

    @Override
    public List<MerchAcctInfoVO> getAcctInfoByMctNos(Integer date,List<String> mctNos) {
        return baseMapper.getAcctInfoByMctNos(date,mctNos);
    }

    @Override
    public List<MerchAcctInfoVO> getAcctNoByMctNosAndMonth(Integer firstDay, Integer lastDay, List<String> mctNos) {
        return baseMapper.getAcctNoByMctNosAndMonth(firstDay,lastDay,mctNos);
    }

    @Override
    public List<String> getMctNosByMonth(Integer firstDay, Integer lastDay) {
        return baseMapper.getMctNosByMonth(firstDay,lastDay);
    }

    @Override
    public List<MerchTradePrimitiveSumVO> getMerchTradeInfoByMonth(Integer firstDay, Integer lastDay, List<String> mctNos) {
        return baseMapper.getMerchTradeInfoByMonth(firstDay,lastDay,mctNos);
    }


}

